package com.quanshu.shop.sort.adapter;

import android.graphics.Color;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.quanshu.exchange.R;
import com.quanshu.shop.sort.entity.SortTypeEntity;

import java.util.List;

/**
 * 作者  李哲
 * 创建时间 2018/7/23
 * 邮箱 lizhetongliao@163.com
 * 说明
 **/
public class SortTypeLeftAdapter extends BaseQuickAdapter<SortTypeEntity.DataEntity,BaseViewHolder>{
    public SortTypeLeftAdapter(@Nullable List<SortTypeEntity.DataEntity> data) {
        super(R.layout.item_sortt_type_left,data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SortTypeEntity.DataEntity item) {
        helper.setText(R.id.item_sort_type_left_txt,item.getName());
        if (item.isSetect){
            helper.setBackgroundColor(R.id.item_sort_type_left_bg, Color.parseColor("#FFFFFF"));
            helper.setVisible(R.id.item_sort_type_left_view,true);
        }else {
            helper.setBackgroundColor(R.id.item_sort_type_left_bg, Color.parseColor("#F3F3F3"));
            helper.setVisible(R.id.item_sort_type_left_view,false);
        }
        helper.addOnClickListener(R.id.item_sort_type_left_bg);
    }
}
